package com.guaju.yueshangLife.widget;

import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;



public class MyCoordinatorLayout extends CoordinatorLayout {
    public MyCoordinatorLayout(Context context) {
        super(context);
    }
    OnScrollChangedListener myScrollChangeListener;


    public MyCoordinatorLayout(Context context, AttributeSet attrs) {
        super(context, attrs);

    }

    public MyCoordinatorLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        if (myScrollChangeListener!=null){
            myScrollChangeListener.onMyScrollChanged(t);
        }

    }


    public interface OnScrollChangedListener{
         void onMyScrollChanged(int top);
    }

    public void setMyScrollChangeListener(OnScrollChangedListener myScrollChangeListener) {
        this.myScrollChangeListener = myScrollChangeListener;
    }
}
